package com.bdqn.hospital.mapper;

import com.bdqn.hospital.pojo.PrescriptionDetail;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @version : 1.0
 * @Author :guogd
 * @createTime: 2023/03/01 14:31
 * @Description: com.bdqn.hospital.mapper
 */
@Mapper
public interface PrescriptionDetailMapper {


    /**
     * 循环添加开药明细表
     * @param prescriptionDetail
     * @return
     */
    @Insert("insert into prescription_detail values(null,#{prescriptionId},#{registryId},#{drugId},#{patientId},#{amount},#{isMedicare},#{price},#{payPrice},#{medicarePrice},now(),null)")
    Integer addPrescriptionDetail(PrescriptionDetail prescriptionDetail);

    /**
     * 根据挂号单id获取开药信息
     * @param registryId
     * @return
     */
    List<PrescriptionDetail> getByRegistryId(Integer registryId);
}
